<template>
  <div class="box">
    <div class="head">
      <van-icon class="arrow-left" name="arrow-left" @click="goBack" /> 确认订单
    </div>
    <div class="content">
      <van-cell title="添加收货地址" is-link  @click="addAdress"/>
      <van-card
      :key="item.proid"
        v-for="item in goodslist"
          class="goodscard"
          :num="item.num"
          :price="item.originprice"
          :title="item.proname"
          :thumb="item.img1"
        >
        </van-card>
      
    </div>
    <van-submit-bar :price="99999900" button-text="支付" @submit="onSubmit" />
  </div>
</template>

<script>
export default {
  data() {
    return {
      goodslist:[]
      
    }
  },
  methods: {
    goBack() {
      this.$router.back();
    },
    addAdress() {
      this.$router.push("/Address")
    },
    onSubmit() {
      
    }
  },
  created() {
    this.token = sessionStorage.getItem("token");
    this.userid = sessionStorage.getItem("userid");
    this.time = sessionStorage.getItem("time");

    console.log("userid", this.userid);

    this.$service({
      method: "get",
      url: "api/order/confirmOrder",
      headers: { token: this.token },
      params: {
        userid:this.userid,
        time:this.time
      }
      
    }).then((res) => {
      console.log("res.data", res.data.data);

      if (res.data.code == 200) {
       
        this.goodslist = res.data.data;
      }
     
    });
  },
};
</script>
<style scoped>
.head {
  position: relative;
  height: 3rem;
  background-color: antiquewhite;
  text-align: center;
  line-height: 3rem;
}
.arrow-left {
  position: absolute;
  top: 1rem;
  left: 1rem;
}
.box {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: #efefef;
}
.content {
  flex: 1;
  overflow: auto;
}
</style>